﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CanDoo.Oil.WebApp.cusCustomer.Default" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>客户管理</title>
    <link href="/res/css/common.css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
        <f:PageManager ID="PageManagerMain" AutoSizePanelID="PanelMain" runat="server" />
        <f:Panel ID="PanelMain" runat="server" BodyPadding="5px"
            ShowBorder="false" Layout="VBox" BoxConfigAlign="Stretch"
            BoxConfigPosition="Start" ShowHeader="false">
            <Items>
                <f:Form ID="SearchBar" runat="server" ShowHeader="false"
                    ShowBorder="false">
                    <Items>
                        <f:Panel ID="PanelSearch" ShowHeader="false" ShowBorder="false" runat="server" Layout="Column" BoxConfigAlign="Stretch">
                            <Items>
                                <f:DropDownList ID="SearchCustomerLevel" runat="server" ShowLabel="false" CssClass="marginr">
                                </f:DropDownList>
                                <f:TextBox ID="ed_CardNoStart" runat="server" ShowLabel="false" EmptyText="起始卡号" MaxLength="50" CssClass="marginr">
                                </f:TextBox>
                                <f:TextBox ID="ed_CardNoEnd" runat="server" ShowLabel="false" EmptyText="结束卡号" MaxLength="50" CssClass="marginr">
                                </f:TextBox>
                                <f:DropDownList ID="ed_Active" runat="server" ShowLabel="false" CssClass="marginr">
                                    <f:ListItem Text="请选择是否激活" Value="0" />
                                    <f:ListItem Text="激活" Value="1" />
                                    <f:ListItem Text="未激活" Value="2" />
                                </f:DropDownList>
                                <f:TwinTriggerBox ID="SearchKey" runat="server" ShowLabel="false" EmptyText="请输入检索关键词"
                                    Trigger1Icon="Clear" Trigger2Icon="Search" ShowTrigger1="false" OnTrigger2Click="search_Key_Trigger2Click"
                                    OnTrigger1Click="search_Key_Trigger1Click" CssClass="marginr">
                                </f:TwinTriggerBox>
                                
                                <f:Button ID="btnSearch" runat="server" Text="查询" CssClass="marginr">
                                </f:Button>
                                <f:Button ID="btnReset" runat="server" Type="Reset" Text="重置">
                                </f:Button>
                            </Items>
                        </f:Panel>
                    </Items>
                </f:Form>
                <f:Grid ID="GridList" runat="server" BoxFlex="1" ShowBorder="true" ShowHeader="false"
                    EnableCheckBoxSelect="true" DataKeyNames="Id" AllowSorting="false"
                    OnSort="GridList_Sort" SortField="ID" SortDirection="DESC" AllowPaging="true"
                    IsDatabasePaging="true" OnPreDataBound="GridList_PreDataBound" OnRowCommand="GridList_RowCommand"
                    OnPageIndexChange="GridList_PageIndexChange" OnRowDataBound="GridList_RowDataBound" EnableTextSelection="true">
                    <Toolbars>
                        <f:Toolbar ID="GridToolbar" runat="server">
                            <Items>
                                <f:Button ID="btnShowSearchBar" runat="server" Text="显示查询">
                                </f:Button>
                                <f:Button ID="btnRefresh" runat="server" Text="刷新">
                                </f:Button>
                                <f:ToolbarSeparator runat="server"></f:ToolbarSeparator>
                                <f:Button ID="btnAdd" runat="server" EnablePostBack="false" Text="新增" Hidden="true" Enabled="false">
                                </f:Button>
                                <f:Button ID="btnEdit" runat="server" Text="编辑" Hidden="true" Enabled="false">
                                </f:Button>
                                <f:Button ID="btnTrash" runat="server" Text="移除" Hidden="true" Enabled="false">
                                </f:Button>
                                <f:Button ID="btnRestore" runat="server" Text="恢复" Hidden="true" Enabled="false">
                                </f:Button>
                                <f:Button ID="btnDelete" runat="server" Text="删除" Hidden="true" Enabled="false">
                                </f:Button>
                                <f:ToolbarSeparator runat="server"></f:ToolbarSeparator>
                                <f:Button ID="btnCopy" runat="server" Text="复制" Hidden="true" Enabled="false">
                                </f:Button>
                                <f:Button ID="btnPrint" runat="server" Text="打印" Hidden="true" Enabled="false">
                                </f:Button>
                                <f:Button ID="btnImport" runat="server" Text="导入" Hidden="true" Enabled="false">
                                </f:Button>
                                <f:Button ID="btnExport" runat="server" Text="导出" Hidden="true" Enabled="false">
                                </f:Button>
                                <f:ToolbarSeparator runat="server"></f:ToolbarSeparator>
                                <f:Button ID="btnActive" runat="server" Text="激活" Hidden="true" Enabled="false" OnClick="btnActive_Click">
                                </f:Button>
                                <f:Button ID="btnBurn" runat="server" Text="已制卡" Hidden="true" Enabled="false" OnClick="btnBurn_Click" >
                                </f:Button>
                                <f:ToolbarFill runat="server"></f:ToolbarFill>
                                <f:CheckBox ID="ManageRecycle" runat="server" Text="管理回收站" AutoPostBack="true" OnCheckedChanged="ManageRecycle_CheckedChanged"></f:CheckBox>
                            </Items>
                        </f:Toolbar>
                    </Toolbars>
                    <PageItems>
                        <f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
                        </f:ToolbarSeparator>
                        <f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数：">
                        </f:ToolbarText>
                        <f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
                            runat="server">
                            <f:ListItem Text="10" Value="10" />
                            <f:ListItem Text="20" Value="20" />
                            <f:ListItem Text="50" Value="50" />
                            <f:ListItem Text="100" Value="100" />
                        </f:DropDownList>
                    </PageItems>
                    <Columns>
                        <f:RowNumberField />
                        <f:BoundField ColumnID="CardNo" DataField="CardNo" HeaderText="卡号" Width="100px" />
                        <f:TemplateField HeaderText="姓名" ColumnID="Name" MinWidth="150px">
                            <ItemTemplate>
                                <a href="javascript:;" onclick="<%#CanDoo.FineUI.FineUIShowHelper.GetUrl(WindowEdit,"View.aspx?id=" + Eval("Id").ToString(), Eval("Name").ToString(),IsMaxMode) %>"><%# Eval("Name")%></a>
                            </ItemTemplate>
                        </f:TemplateField>
                        <f:TemplateField HeaderText="性别" ColumnID="Sex" Width="60px">
                            <ItemTemplate>
                                <%#CanDoo.FineUI.FineUIBindList.ShowSex(CanDoo.Extensions.ObjectExtensions.ToInt(Eval("Sex")))%>
                            </ItemTemplate>
                        </f:TemplateField>
                        <f:BoundField ColumnID="MobilePhone" DataField="MobilePhone" HeaderText="手机号" Width="120px" />

                        <f:TemplateField HeaderText="账户余额" ColumnID="Balance" MinWidth="80px">
                            <ItemTemplate>
                                <a href="javascript:;" onclick="<%#CanDoo.FineUI.FineUIShowHelper.GetUrl(WindowEdit,"Recharge1.aspx?IS_RETURN=1&id=" + Eval("Id").ToString(), Eval("Name").ToString(),false) %>"><%# ShowBalance(Eval("Balance"),Eval("CardType"))%></a>
                            </ItemTemplate>
                        </f:TemplateField>

                        <f:BoundField ColumnID="Denomination" DataField="Denomination" HeaderText="面额" Width="60px" />
                        <f:CheckBoxField ColumnID="IsBurn" DataField="IsBurn" HeaderText="已制卡" Width="80px" />
                        
                        <f:CheckBoxField ColumnID="Status" DataField="Status" HeaderText="激活" Width="60px" />
                        <f:BoundField ColumnID="Activate.Name" DataField="Activate.Name" HeaderText="激活人" Width="100px" />
                        <f:BoundField ColumnID="ActivateTime" DataField="ActivateTime" HeaderText="激活时间" Width="140px" DataFormatString="{0:yyyy-MM-dd hh:mm:ss}"/>

                        <f:BoundField ColumnID="CustomerLevel" DataField="CustomerLevel.Name" HeaderText="客户等级" Width="80px" />
                        <%--<f:BoundField ColumnID="CardType" DataField="CardType" HeaderText="客户类别" Width="80px" />--%>
                        <f:BoundField ColumnID="LimitProduct" DataField="LimitProduct.Name" HeaderText="可消费油品" Width="150px" />
                        
                        <f:BoundField ColumnID="Remark" DataField="Remark" HeaderText="备注" ExpandUnusedSpace="true" />
                        <f:TemplateField HeaderText="编辑" Width="50px" ColumnID="cEdit" Hidden="true">
                            <ItemTemplate>
                                <a href="javascript:;" onclick="<%#CanDoo.FineUI.FineUIShowHelper.GetEditUrl(WindowEdit,Eval("Id").ToString(), Eval("Name").ToString(),IsMaxMode) %>">编辑</a>
                            </ItemTemplate>
                        </f:TemplateField>
                        <f:LinkButtonField ColumnID="cDelete" TextAlign="Center" HeaderText="删除" Text="删除" ToolTip="删除" Hidden="true"
                            ConfirmText="确定删除此记录？" ConfirmTarget="Top" CommandName="Delete" Width="50px" />
                    </Columns>
                </f:Grid>
            </Items>
        </f:Panel>
        <f:Window ID="WindowEdit" CloseAction="Hide" runat="server" IsModal="true" Hidden="true" Target="Top"
            EnableResize="true" EnableMaximize="true" EnableIFrame="true" IFrameUrl="about:blank"
            Width="900px" Height="500px" OnClose="WindowEdit_Close">
        </f:Window>
    </form>
</body>
</html>
